<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    const singers = [
        { name: 'Steven Tyler', band: 'Aerosmith', born: 1948 },
        { name: 'Karen Carpenter', band: 'The Carpenters', born: 1950 },
        { name: 'Kurt Cobain', band: 'Nirvana', born: 1967 },
        { name: 'Stevie Nicks', band: 'Fleetwood Mac', born: 1948 },
    ];
    console.log(singers.sort((a,b) => b.born - a.born))
    // 正着升序，反着降序
</script>
</html>